package com.gtxc.kotlinmvvm.adapater;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gtxc.kotlinmvvm.R;
import com.gtxc.kotlinmvvm.bean.ViewItemBean;
import com.gtxc.kotlinmvvm.network.request.DaiLiBean;

import org.jetbrains.annotations.NotNull;

/**
 * FileName:AgencyAdapater
 * Author：Administrator
 * Date:2021 2021/9/30 14:39
 * Copyright (C), 2020-2021,成都拇音科技有限公司
 * <p>
 * <p>
 * Description: 代理a适配器
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
public class AgencyAdapater extends BaseQuickAdapter<DaiLiBean, BaseViewHolder> {
    public AgencyAdapater(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, DaiLiBean daiLiBean) {

        baseViewHolder.setText(R.id.tv_b,daiLiBean.getB());
        baseViewHolder.setText(R.id.tv_c,daiLiBean.getC());
        baseViewHolder.setText(R.id.tv_d, daiLiBean.getD() ?"已完成":"未完成");
        switch (baseViewHolder.getPosition()){
            case   1:
                baseViewHolder.setText(R.id.tv_a,"本省节点:"+daiLiBean.getA());
                break;
            case   2:
                baseViewHolder.setText(R.id.tv_a,"市代节点:"+daiLiBean.getA());
                break;
            case   3:
                baseViewHolder.setText(R.id.tv_a,"区县节点:"+daiLiBean.getA());
                break;
            case   4:
                baseViewHolder.setText(R.id.tv_a,"乡镇节点:"+daiLiBean.getA());
                break;
            case   5:
                baseViewHolder.setText(R.id.tv_a,"村代节点:"+daiLiBean.getA());
                break;
        }

    }

    @Override
    public int getItemViewType(int position) {
        return position;
    }
}
